package test;
import static org.junit.Assert.*;
import math.Point3f;
import math.Ray;
import math.Triangle;
import math.Vector3f;

import org.junit.Test;


public class testTriangle {

	@Test
	public void testIntersect() {
		Ray ray = new Ray(new Point3f(0,0,0), new Vector3f(1, 1, 1));
		Triangle triangle = new Triangle(new Point3f(1, 0, 0),
				new Point3f(0,1,0),
				new Point3f(0,0,1));
		assertTrue(triangle.intersect(ray, 0, Float.MAX_VALUE) != null);
		
		ray = new Ray(new Point3f(0,0,0), new Vector3f(-1, -1, -1));
		assertTrue(triangle.intersect(ray, 0, Float.MAX_VALUE) != null);
	}

}
